package com.authorization.demo.exception;

import com.authorization.demo.enums.TokenExceptionEnum;
import lombok.Data;

/**
 * @Remarks:
 * @ClassName: TokenException
 * @Author: Micora
 * @CreateTime: 2022/7/29
 */
@Data
public class TokenException extends RuntimeException {

    private Integer code;
    private String msg;

    public TokenException(TokenExceptionEnum tokenExceptionEnum) {
        super(tokenExceptionEnum.getMsg());
        this.code = tokenExceptionEnum.getCode();
        this.msg = tokenExceptionEnum.getMsg();
    }
}
